#include <iostream>

#include "net_common.h"
#include "net/tcp_client.h"
#include <thread>

// net::ip::address addr = net::ip::make_address("172.17.0.2");
// tcp::endpoint endpoint(net::ip::address(addr), 12345);
// client_ptr->start(endpoint);

int main()
{
    net::io_context ioc;
    net::ip::address addr = net::ip::make_address("172.17.0.2");
    auto tcp_clinet = std::make_shared<tcp_client>(ioc);
    auto ep = tcp::endpoint(boost::asio::ip::address(addr), 12345);

    tcp_clinet->start(ep);

    std::thread t([&ioc]() {
        ioc.run();
    });

    t.detach();

    sleep(100);
    return 0;
}
